#include <cmath>
#include <iostream>
using namespace std;

int main() {
    long long x;
    cin >> x;
    long k = sqrt(x);
    long long low = k * k;
    long long high = (k + 1) * (k + 1);
    if ((high - x) >= (x - low)) cout << low << endl;
    else cout << high << endl;
    return 0;
}
